import 'package:flutter/material.dart';
import "./CustomWidget.dart";
import './TabPage.dart';
import './LayoutTest.dart';
import 'stepper/StepperTest.dart';

class TestPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new TestPageState();
}

class TestPageState extends State<TestPage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          centerTitle: true,
          title: new Text("测试页面"),
          iconTheme: new IconThemeData(color: Colors.white),
          // leading: new Icon(Icons.chevron_left, size: 40.0, color: Colors.white,),
          actions: <Widget>[
            new IconButton(
              icon: new Icon(Icons.more_vert, size: 40.0, color: Colors.white),
              onPressed: () {
                // Navigator.of(context).push(
                //   new MaterialPageRoute(builder: (BuildContext context) => new ScorePage(applyId: 510))
                // );
              },
            ),
            
          ],
        ),
        body: new ListView(
          children: <Widget>[
            _createListTile('自定义插件', context, new CustomWidget()),
            // _createListTile('注册页面', context, new RegisterPage()),
            // _createListTile('评价页面', context, new ScorePage(applyId: 510,)),
            // _createListTile('我的页面', context, new MyInfoPage()),
            _createListTile('Tab页面', context, new TabPage()),
            _createListTile('常用布局', context, new LayoutTest()),
            _createListTile("流程指示", context, new StepperTest())
          ],
        )
      );
  }

  Widget _createListTile(String title, BuildContext context, Widget page) {
    return new ListTile(
      title: new Text(title),
      onTap: (){
        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context) => page));
      },
    );
  }
}
